import VueRouter from 'vue-router'
import Vue from 'vue'
// live
import LiveView from './views/live/Live.vue'
import LiveInfoView from './views/live/LiveInfo.vue'
import LiveRecord from './views/live/LiveRecord.vue'
import LiveSignRecord from './views/live/LiveSignRecord.vue'
import LiveProblem from './views/live/LiveProblem.vue'

// class
import ClassView from './views/class/ClassView.vue'
import ClassNewView from './views/class/ClassNew.vue'
import ClassShow from './views/class/ClassShow.vue'
import ClassManage from './views/class/ClassManage.vue'

//course
import CourseView from './views/course/CourseView.vue'
import CourseNew from './views/course/CourseNew.vue'
import CourseShow from './views/course/CourseShow.vue'
import CourseInfo from './views/course/CourseInfo.vue'
import CourseCorrectingWork from './views/course/CourseCorrectingWork.vue'

//work
import WorkView from './views/work/WorkView.vue'
import WorkNew from './views/work/WorkNew.vue'
import PostponeReq from './views/work/PostponeReq.vue'
import PostponeWorkInfo from './views/work/PostponeWorkInfo.vue'
import WorkUpdate from './views/work/WorkUpdate.vue'


//other
import ReplyView from './views/other/ReplyView.vue'
import UserView from './views/other/UserView.vue'

//使用 vue-router
Vue.use(VueRouter)

//配置 router信息
const routes = [
    {
        path: '/',
        redirect: '/live/info',
    },
    {
        path: '/live',
        component: LiveView,
        children: [
            {path: 'info',component: LiveInfoView,},
            {path: 'start_record',component: LiveRecord,},
            {path: 'sign',component: LiveSignRecord,},
            {path: 'problem',component: LiveProblem,},
        ]
    },
    {
        path: '/class',
        component: ClassView,
        children: [
            {path: 'new',component: ClassNewView,},
            {path: 'show',component: ClassShow,},
            {path:"manage",name:"/class/manage",component: ClassManage,}
        ]
    },
    {
        path:"/course",
        component: CourseView,
        children: [
            {path: 'new',component:CourseNew},
            {path: 'show',component:CourseShow,},
            {path:"show/info",name:"CourseInfo",component: CourseInfo,},
            {
                path:"show/info/correcting-work",
                name:"CourseCorrectingWork",
                component: CourseCorrectingWork,
            }
        ]
    },
    {
        path:"/work",
        component:WorkView, 
        children:[
            {path: 'new',component:WorkNew},
            {path: 'update', name:'WorkUpdate', component:WorkUpdate},
            {path: 'post-pone-req',component:PostponeReq,},
            {path: 'post-pone-req/info',name:"postponeWorkInfo",component:PostponeWorkInfo},
        ]
    },
    {
        path:'/stu-record',
        component: ReplyView
    },
    {
        path:'/user',
        component: UserView
    }
]

const router = new VueRouter({
    routes
})

export default router;